<?php
namespace App\Http\Controllers\Backend\Member;

use App\Http\Controllers\Backend\BaseController;
use App\Http\Requests\Backend\member\levelRequest;
use App\Repositories\PrtMemberLevelRepository;

/**
 * 会员等级控制器相关功能
 * @author:yanxs<541139655@qq.com>
 * @version: 1.0
 * @date:2021/7/13
 */
class LevelController extends BaseController
{
    protected $viewPath = 'backend.member.level';  //当前控制器所的view所在的目录
    protected $modules = 'member';        //当前控制器所属模块
    protected $codePrefix = '';        //编码前缀
    public function __construct(PrtMemberLevelRepository $Repository)
    {
        parent::__construct();
        $this->repositories = $Repository;
    }

   //添加/编辑操作
    public function save(LevelRequest $request)
    {
        $params = $request->all();
       // $params['sys_code'] = $this->codePrefix;
        $userInfo = $this->getUserInfo();

        $ret = $this->repositories->save($params);
        if ($ret) {
            return $this->jsonSuccess([]);
        } else {
            return $this->jsonFailed('');
        }
    }

}
